<div class='weui-flex' id="user-modify" style="min-height:400px;width:80%;margin: 0 auto;">
	<div class='weui-flex__item' style='flex:1.5; '>
		<div class='weui-cells__title'>基本信息</div>
		<div class='weui-cells bc-district'>
			<div class='weui-cell'>
				<div class='weui-cell__hd'>
					<label class='weui-label'>真实姓名</label>
				</div>
				<div class='weui-cell__bd'>
					<input id="name-modify" class='user-modify weui-input' info=1 name='real_name' placeholder="请输入真实姓名" />
				</div>
			</div>
			<!--<div class='weui-cell'>-->
				<!--<div class='weui-cell__hd'>-->
					<!--<label class='weui-label'>推荐者</label>-->
				<!--</div>-->
				<!--<div class='weui-cell__bd'>-->
					<!--<input class='user-modify weui-input' info=1 name='jieshao' placeholder="请输入推荐人会员号" />-->
				<!--</div>-->
			<!--</div>-->
			<div class='weui-cell'>
				<div class='weui-cell__hd'>
					<label class='weui-label'>生日</label>
				</div>
				<div class='weui-cell__bd'>
					<input type='date' class='user-modify weui-input' info=1 name='birth' placeholder="1990-01-01" />
				</div>
			</div>
			<div class='weui-cell'>
				<div class='weui-cell__hd'>
					<label class='weui-label'>身份证号码</label>
				</div>
				<div class='weui-cell__bd'>
					<input class='user-modify weui-input' info=1 name='identity_id' placeholder="请输入身份证号" />
				</div>
			</div>
			<div class='weui-cell'>
				<div class='weui-cell__hd'>
					<label class='weui-label'>省市</label>
				</div>
				<div class='weui-cell__bd'>
					<!-- <input class='user-modify weui-input' info=1 name='province' placeholder="请输入所在省市" /> -->
					<select class='user-modify weui-input' id='a'  info=1 name='province' placeholder="请输入所在省市" ></select>
				</div>
			</div>
			<div class='weui-cell'>
				<div class='weui-cell__hd'>
					<label class='weui-label'>市区</label>
				</div>
				<div class='weui-cell__bd'>
					<select class='user-modify weui-input' id="b"  info=1 name='city' placeholder="请输入所在市区" ></select>
					<!-- <input class='user-modify weui-input' info=1 name='city' placeholder="请输入所在市区" /> -->
				</div>
			</div>
			<div class='weui-cell'>
				<div class='weui-cell__hd'>
					<label class='weui-label'>区县</label>
				</div>
				<div class='weui-cell__bd'>
					<!-- <input class='user-modify weui-input' info=1 name='district' placeholder="请输入所在区县" /> -->
					<select class='user-modify weui-input' id ="c" info=1 name='district' placeholder="请输入所在区县" ></select>
				</div>
			</div>
		</div>
	</div>
	<div class='weui-flex__item'>
		<display>
			<div class='weui-cells__title'>信息验证</div>
			<div class='weui-cells'>
				<div class='weui-cell weui-cell_access'>
					<div class='weui-cell__hd'>
						<label class='weui-label'>
							手机
							<tel info=d><span class='weui-icon weui-icon-success-no-circle weui-icon-original'></span></tel>
						</label>
					</div>
					<div class='weui-cell__bd' style='color:#aaa'>
						<tel info=1>绑定手机</tel>
						<tel info='none'>
							<a style='color:blue' href='#bind_tel'>绑定手机</a>
						</tel>
					</div>
					<tel info=none class='weui-cell__ft'></tel>
				</div>
				<div class='weui-cell weui-cell_access'>
					<div class='weui-cell__hd'>
						<label class='weui-label'>
							微信
							<openid info=d><span class='weui-icon weui-icon-success-no-circle weui-icon-original'></span></openid>
						</label>
					</div>
					<div class='weui-cell__bd' style='color:#aaa'>
						<openid info=d><span>已绑定</span></openid>
						<openid info='none'>
							<a style='color:blue' href='#bind_wechat'>绑定微信</a>
						</openid>
					</div>
					<openid info=none class='weui-cell__ft'></openid>
				</div>
				<div class='weui-cell weui-cell_access' >
					<div class='weui-cell__hd'>
						<label class='weui-label'>
							邮箱
							<email info=d><span class='weui-icon weui-icon-success-no-circle weui-icon-original'></span></email>
						</label>
					</div>
					<div class='weui-cell__bd' style='color:#aaa'>
						<email info=1></email>
						<email info='none' >
							<a style='color:blue' href='#bind_email'>绑定邮箱</a>
						</email>
					</div>
					<email info=none class='weui-cell__ft'></email>
				</div>
			</div>
			<div class='weui-cells__title'>密码</div>
			<div class='weui-cells'>
				<div class='weui-cell weui-cell_access'>
					<div class='weui-cell__hd'>
						<label class='weui-label'>
							密码
							<password info=d><span class='weui-icon weui-icon-success-no-circle weui-icon-original'></span></password>
						</label>
					</div>
					<a href='#password' class='weui-cell__bd'>
						<password info=d style='color:#aaa'><span>修改密码</span></password>
						<password info=none style='color:blue'>设置密码</password>
					</a>
					<div class='weui-cell__ft'>
					</div>
				</div>
			</div>
			<div class='weui-btn-area'>
				<a class='hidden weui-btn weui-btn_primary' id='redirect-btn'>填写完毕</a>
			</div>
		</display>
	</div>
	<!--<div class='weui-flex__item' style='flex:0.3'>-->
	<!--</div>-->
</div>

<!--<div class="weui-flex" style="min-height:300px;width:80%;margin: 0 auto;">-->
	<!--{include file='home:my-photos-template'}-->
<!--</div>-->


<div class='weui-btn-area'>
	<a class='weui-btn weui-btn_warn visible-xs' id='logout'>退出登录</a>
	<br/>
</div>
<script>
    $(function(){
        if(GET('redirect')){
            var needAlert = 0;
            $('#redirect-btn').removeClass('hidden');
            $('#user-info-my').on("bc-info-success",function(){
                $('input.user-modify').each(function(index,el){
                    var e = $(el);
                    if(e.val()==""){

                        e.parents('.weui-cell').addClass('weui-cell_warn');
                        needAlert = 1;
                    }
                })
                setTimeout(function(){
                    $('select.user-modify').each(function(index,el){
                        var e = $(el);
                        if(e.val()==''){
                            e.parents('.weui-cell').addClass('weui-cell_warn');
                            needAlert = 1;
                        }
                    })
                },200)
//                $('select.user-modify').each(function(index,el){
//                    var e = $(el);
//                    if(e.val()==1){
//                        e.parents('.weui-cell').addClass('weui-cell_warn');
//                        e.addClass('weui-cell_warn');
//                        needAlert = 1;
//                    }
//                }).delay(200);
//                setTimeout(function () {
//                    var sel=document.getElementById('a');
//                    var sel1=document.getElementById('b');
//                    var sel2=document.getElementById('c');
//                    if((sel.options[sel.selectedIndex].value)==1){
//                        sel.parentNode.parentNode.className = "weui-cell weui-cell_warn";
//                        needAlert = 1;
//					};
//                    if((sel1.options[sel1.selectedIndex].value)==1){
//                        sel1.parentNode.parentNode.className = "weui-cell weui-cell_warn";
//                        needAlert = 1;
//                    };
//                    if((sel2.options[sel2.selectedIndex].value)==1){
//                        sel2.parentNode.parentNode.className = "weui-cell weui-cell_warn";
//                        needAlert = 1;
//                    };
//
//                },200);
                if(needAlert){
                    TOAST.warn("请完善您的个人信息", ' ', 2);
                }
            })
        }

        $('#redirect-btn').on('click',function(){
            location.href=GET('redirect');
        })
        POST.init(".user-modify",{
            method:"change",
            url:"/user/modify",
            style:'input',
            input:function(e){
                var t = $(e);
                var key = t.attr('name');
                var value = t.val();
                return {key:key,value:value}
            },
            success:function(){
                INFO.cache.user = null
            }
        })
        $("#name-modify").on('bc-post-success',function(){
            $("#user-name").html($(this).val());
        })
    })
</script>